const app = getApp()
let page
Page({
  data: {
    list: [],
    jujialist: [],
    meishilist: [],
    fushilist: [],
    muyinglist: [],
    gehulist: [],
    shumalist: [],
    yundonglist: [],
    winHeight: "", //窗口高度
    currentTab: 0, //预设当前项的值
    scrollLeft: 0,
    content: '0',
    imgWidth: 0,
    imgHeight: 0, //tab标题的滚动条位置
    tabbar: ["首页", "居家", "美食", "服饰", "母婴", "个护", "数码", "运动"],
    swiper_img: [{
        url: 'https://636c-cloud1-7gc8wxgme5a29f3b-1306098103.tcb.qcloud.la/cloudbase-cms/upload/2021-12-13/svto13eatnmymqt7iwqicilvvc8jehp8_.PNG'
      },
      {
        url: 'https://636c-cloud1-7gc8wxgme5a29f3b-1306098103.tcb.qcloud.la/cloudbase-cms/upload/2021-12-13/s347ohab273ahbjg61wvbeyikicf63ry_.PNG'
      },
      {
        url: ' https://636c-cloud1-7gc8wxgme5a29f3b-1306098103.tcb.qcloud.la/cloudbase-cms/upload/2021-12-13/qjip27jf50i1goddu0nkj2o3vomm6f9r_.PNG'
      }
    ],
    functions: [{
        icon: "/images/nav1.png",
        name: "限时秒杀",
        url: "../shouye/shouye"
      },
      {
        icon: "/images/nav2.png",
        name: "小兔超市",
        url: "../shouye/shouye"
      },
      {
        icon: "/images/nav3.png",
        name: "小兔拼购",
        url: "../shouye/shouye"
      },
      {
        icon: "/images/nav4.png",
        name: "手机数码",
        url: "../shouye/shouye"
      },
      {
        icon: "/images/nav5.png",
        name: "小兔家电",
        url: "../shouye/shouye"
      },
      {
        icon: "/images/nav6.png",
        name: "免费水果",
        url: "../shouye/shouye"
      },
      {
        icon: "/images/nav7.png",
        name: "尊贵会员",
        url: "../shouye/shouye"
      },
      {
        icon: "/images/nav8.png",
        name: "签到有礼",
        url: "../shouye/shouye"
      },
      {
        icon: "/images/nav9.png",
        name: "领券中心",
        url: "../shouye/shouye"
      },
      {
        icon: "/images/nav10.png",
        name: "更多频道",
        url: "../shouye/shouye"
      }
    ],
    horitem: [{
        img: "https://image3.suning.cn/uimg/cms/img/163903506483432487.gif",
        url: "../shouye/shouye"
      },
      {
        img: "https://image1.suning.cn/uimg/cms/img/163903507041206523.gif",
        url: "../shouye/shouye"
      },
      {
        img: "https://image2.suning.cn/uimg/cms/img/163903507623979319.gif",
        url: "../shouye/shouye"
      }
    ],
    sectionitem: [{
        img: "https://image3.suning.cn/uimg/cms/img/161974540225898644.jpg?format=_is_200w_200h.webp",
        price: 1999,
        url: "../shouye/shouye"
      },
      {
        img: "https://image1.suning.cn/uimg/cms/img/161974542869886115.jpg?format=_is_200w_200h.webp",
        price: 4999,
        url: "../shouye/shouye"
      },
      {
        img: "https://imgservice.suning.cn/uimg1/sniss/improve/sXpotQ0d5fUqXTbRXD5EXg.jpg?format=_is_200w_200h_4e.webp",
        price: 1899,
        url: "../shouye/shouye"
      },
      {
        img: "https://image2.suning.cn/uimg/nmps/MBLSPZT/10108934810635524329picH_1_370x370.jpg",
        price: 99,
        url: "../shouye/shouye"
      },
      {
        img: "https://imgservice.suning.cn/uimg1/b2c/image/4JOLVDuZvWMvt_fMiv1kJQ.jpg?format=_is_200w_200h_4e.webp",
        price: 19,
        url: "../shouye/shouye"
      },
      {
        img: "https://imgservice.suning.cn/uimg1/sniss/improve/VbX-ax9R1Ho3jC0855AoWw.jpg?format=_is_200w_200h_4e.webp",
        price: 199,
        url: "../shouye/shouye"
      },
      {
        img: "https://imgservice.suning.cn/uimg1/sniss/improve/pzDs1nSLj2lVYr9WqTSi5A.jpg?format=_is_200w_200h_4e.webp",
        price: 29.9,
        url: "../shouye/shouye"
      }
    ],
    topicitem: [{
        title: "品牌闪购",
        tip: "汇大牌好价",
        color: "purple",
        img: "https://gw3.alicdn.com/bao/uploaded/i4/1115488308/O1CN01rsWawZ2BF7EpSEztM_!!2-item_pic.png_210x210.jpg",
        url: "../shouye/shouye"
      },
      {
        title: "排行榜",
        tip: "跟榜购好物",
        color: "#ed647a",
        img: "https://gw.alicdn.com/tps/O1CN01XG2I9h2A4kepCzpmr_!!6000000008150-0-yinhe.jpg_360x10000Q75.jpg_.webp",
        url: "../shouye/shouye"
      },
      {
        title: "每日特价",
        tip: "9块9疯抢",
        color: "#f08d66",
        img: "https://gw.alicdn.com/tps/i2/1031283544/O1CN01MztYtX1c3CHUDeXel_!!1031283544.png_360x10000.jpg_.webp",
        url: "../shouye/shouye"
      },
      {
        title: "新品首发",
        tip: "全网抢先购",
        color: "#8baff5",
        img: "https://gw.alicdn.com/tps/O1CN018haNoi1jQk3MvJMEA_!!6000000004543-0-yinhe.jpg_360x10000Q75.jpg_.webp",
        url: "../shouye/shouye"
      }
    ],
    recommenditem: [{
        title: "12.12平台力荐",
        color: "#ff6fb3",
        height: " 295",
        active: "满2送1",
        url: "../shouye/shouye",
        img: "https://img14.360buyimg.com/seckillcms/s500x500_jfs/t1/142004/15/21934/29060/61a5998bEe7720703/218922cef8a330c3.jpg",
        img2: "https://image.suning.cn/uimg/b2c/qrqm/0000000000000000000101341551.jpg?format=_is_200w_200h_4e.webp"
      },
      {
        title: "12.12平台热销",
        color: "#5f8eff",
        height: " 295",
        active: "满1000减100",
        url: "../shouye/shouye",
        img: "https://img11.360buyimg.com/seckillcms/s420x420_jfs/t1/220803/4/7249/77576/61b33935E0ccf82be/ad42c3dbc777d906.jpg",
        img2: "https://image1.suning.cn/uimg/cms/img/160941888895990187.png?from=mobile"
      },
      {
        title: "12.12精选会场",
        color: "#a13efe",
        height: " 295",
        active: "好物9.9元抢",
        url: "../shouye/shouye",
        img: "https://img14.360buyimg.com/mobilecms/s300x300_jfs/t3850/3/2868061107/181947/58ec59f9/586c9debNb17b469e.jpg!q70.jpg.webp",
        img2: "https://img12.360buyimg.com/seckillcms/s500x500_jfs/t1/175333/20/21857/115027/61af26d4Efe1d815f/95b70cbc0f785fbe.jpg"
      },
      {
        title: "12.12热卖会场",
        color: "#fe6751",
        height: " 295",
        active: "爆品12.12元抢",
        url: "../shouye/shouye",
        img: "https://img12.360buyimg.com/seckillcms/s500x500_jfs/t1/126642/39/20926/140885/6154530aE9be8df44/f6b29cfe2c2ce083.jpg",
        img2: "https://img14.360buyimg.com/seckillcms/s500x500_jfs/t1/221219/9/5287/196629/61b1bb08E9bc1c4d2/02c299f1fad3eb7f.jpg"
      }
    ],
    //  居家
    jjClassify: [{
        icon: "https://img14.360buyimg.com/babel/s300x300_jfs/t1/179574/6/1432/469737/608a3642E548a36f2/83dc12de2a69542e.jpg.webp",
        name: "抽纸",
      },
      {
        icon: "https://img14.360buyimg.com/babel/s300x300_jfs/t1/194721/11/17203/294779/61109935E1456c155/d36cf41378f149c5.jpg.webp",
        name: "口罩",
      },
      {
        icon: "https://img30.360buyimg.com/babel/s300x300_jfs/t1/173913/24/20586/53369/60f8d69dEb2e8a5cd/ac848ae9c5e4f7c3.jpg.webp",
        name: "梳子",
      },
      {
        icon: "https://img12.360buyimg.com/n2/jfs/t14365/243/1452903567/70656/36b825f3/5a4f1f76Ndddef9ae.jpg!q80.webp",
        name: "储物柜",
      },
      {
        icon: "https://img12.360buyimg.com/babel/s300x300_jfs/t1/117838/33/14332/74921/5f2d1ed6E8b1bbd74/38e4645463def9ed.jpg.webp",
        name: "水杯",
      },
      {
        icon: "https://img12.360buyimg.com/babel/s300x300_jfs/t1/131665/31/1472/186817/5ed8c6adEd112902f/e0cc0bada03706d7.jpg.webp",
        name: "便签",
      },
      {
        icon: "https://img14.360buyimg.com/babel/s300x300_jfs/t1/128013/7/15239/88023/5f88f6c8E2eeb5a48/3fe0977737f140af.jpg.webp",
        name: "花盆",
      },
      {
        icon: "https://img10.360buyimg.com/babel/s300x300_jfs/t1/192986/37/15024/112178/60ffb864E0e025f8e/bba7d2ff2bbce8be.jpg.webp",
        name: "茶叶",
      },
      {
        icon: "https://img11.360buyimg.com/babel/s300x300_jfs/t1/158749/29/13480/66066/604f21c7E19cff0a4/48677acb930e0c5e.jpg.webp",
        name: "玻璃瓶",
      },
      {
        icon: "https://img14.360buyimg.com/babel/s300x300_jfs/t1/194721/11/17203/294779/61109935E1456c155/d36cf41378f149c5.jpg.webp",
        name: "汽车",
      }
    ],
    jjgoods: [{
        img: "https://img10.360buyimg.com/n2/jfs/t1819/197/1676240399/94880/3254ba9b/5601f7beNd096cbca.jpg!q80.webp",
        price: 229,
      },
      {
        img: "https://img13.360buyimg.com/n2/jfs/t2728/285/2034263056/59715/8dcc090f/57550c8bN0f6cbdc5.jpg!q80.webp",
        price: 18,
      },
      {
        img: "https://img10.360buyimg.com/n2/jfs/t4033/136/1257531300/596204/9ce035cb/586dd763Ncd4b98a7.jpg!q80.webp",
        price: 35,
      },
      {
        img: "https://img13.360buyimg.com/n2/jfs/t3034/96/2046601838/149553/cdfda1b7/57d13c09N856c3513.jpg!q80.webp",
        price: 79,
      },
      {
        img: "https://img12.360buyimg.com/n2/jfs/t3241/359/3430222978/95075/ab1b478c/57f31638Nfee97522.jpg!q80.webp",
        price: 99,
      },
      {
        img: "https://img12.360buyimg.com/n2/jfs/t2623/315/2787326879/50781/c294f620/577491adN619d09b1.jpg!q80.webp",
        price: 35,
      }

    ],
    // 美食
    msClassify: [{
        icon: "https://m.360buyimg.com/babel/jfs/t1/103684/30/14119/346433/5e5f7997Eff54bc87/d4fa38c109699a88.jpg!q70.jpg",
        name: "苹果",
      },
      {
        icon: "https://m.360buyimg.com/babel/jfs/t1/202705/27/12317/146232/616fbd3bE7e2f0aef/4caca8359e8bc245.jpg!q70.jpg",
        name: "橙子",
      },
      {
        icon: "https://m.360buyimg.com/babel/jfs/t1/194933/29/18567/148407/611cb83bEeb16d199/4b99f7bfc86afddc.jpg!q70.jpg",
        name: "火龙果",
      },
      {
        icon: "https://m.360buyimg.com/babel/jfs/t1/188741/8/16544/292953/610b9c0eE4a22d5f0/72b3d5c3d814a802.jpg!q70.jpg",
        name: "鳕鱼",
      },
      {
        icon: "https://img10.360buyimg.com/babel/s300x300_jfs/t1/7168/30/13593/167572/5c471aa3E1f53779c/66fd0f6a674faf44.jpg",
        name: "草莓",
      },
      {
        icon: "https://img11.360buyimg.com/babel/s300x300_jfs/t20188/121/2634102821/163260/a16b8fcf/5b5eb065N1dbbabaa.jpg",
        name: "海鲜",
      },
      {
        icon: "https://img10.360buyimg.com/babel/s300x300_jfs/t3493/253/425253315/176995/19f2a2b2/5808619cN27390691.jpg!q80.webp",
        name: "三文鱼",
      },
      {
        icon: "https://img10.360buyimg.com/babel/s300x300_jfs/t1/18853/36/11497/95597/5c906181Edcbea8eb/d61860830f5abfb4.jpg!q80.webp",
        name: "牛奶",
      },
      {
        icon: "https://img10.360buyimg.com/babel/s300x300_jfs/t1/51149/2/2469/310788/5d049a2dEc211938e/63065dba8eb181af.jpg!q80.webp",
        name: "玉米",
      },
      {
        icon: "https://img13.360buyimg.com/babel/s300x300_jfs/t17614/30/217738100/211833/4797208b/5a65595fNa8a140db.jpg!q80.webp",
        name: "猕猴桃",
      }
    ],
    msgoods: [{
        img: "https://img14.360buyimg.com/babel/s300x300_jfs/t18223/6/229592867/547530/bb4ec612/5a6595afN4cbebc2e.jpg!q80.webp",
        price: 209,
      },
      {
        img: "https://img12.360buyimg.com/babel/s300x300_jfs/t1/673/32/9600/388803/5bac43e5E51400211/41459b4ba4a34abc.jpg",
        price: 158,
      },
      {
        img: "https://img10.360buyimg.com/n7/jfs/t1/134999/2/10463/145867/5f67ea9cE6324334b/66bdafda1566d979.jpg",
        price: 39.9,
      },
      {
        img: "https://img13.360buyimg.com/n7/jfs/t1/161290/35/25577/47440/6192382aE4aa5f1c8/81f360e9b2ba6a71.jpg",
        price: 168,
      },
      {
        img: "https://img11.360buyimg.com/babel/s300x300_jfs/t17323/133/342988625/418250/308f8fdb/5a6e7133N2f10bd9b.jpg!q80.webp",
        price: 38.8,
      },
      {
        img: "https://img11.360buyimg.com/n7/jfs/t1/171448/18/26458/508797/61b09685E423ae76e/12a9b201d37dc126.jpg",
        price: 129.9,
      }

    ],
    // 服饰
    fsClassify: [{
        icon: "https://img20.360buyimg.com/babel/s300x300_jfs/t1/191066/18/17618/162526/6112c644Eb90486ec/8965beedac866ba9.jpg.webp",
        name: "手表",
      },
      {
        icon: "https://img10.360buyimg.com/babel/s300x300_jfs/t1/214893/11/2606/124351/617f53f2Ed872302d/3b427d000ab2beb3.jpg.webp",
        name: "斜挎包",
      },
      {
        icon: "https://img20.360buyimg.com/babel/s300x300_jfs/t1/216781/23/5484/90546/619c4e0fEc0a31a9c/127a1021fa88de40.jpg.webp",
        name: "面霜",
      },
      {
        icon: "https://img11.360buyimg.com/babel/s300x300_jfs/t1/7770/8/11143/277589/5c297739E78298562/7118024d6aa700e9.jpg.webp",
        name: "皮鞋",
      },
      {
        icon: "https://img12.360buyimg.com/babel/s300x300_jfs/t1/219429/25/8189/38345/61bc46c7E4f95b5e1/cb9f220f3af75c37.jpg.webp",
        name: "短袖",
      },
      {
        icon: "https://img11.360buyimg.com/babel/s300x300_jfs/t1/176828/33/11031/32383/60d3f63cE4ace9052/882d0f1f66a583af.jpg.webp",
        name: "护手霜",
      },
      {
        icon: "https://img20.360buyimg.com/babel/s300x300_jfs/t1/208628/12/13329/277988/61c01850E90e305a7/feef0150600d881a.jpg.webp",
        name: "跑步鞋",
      },
      {
        icon: "https://img14.360buyimg.com/babel/s300x300_jfs/t1/216145/4/5402/46269/619cb1c6E58f2317c/c2bcea66c6f59b76.jpg.webp",
        name: "手提包",
      },
      {
        icon: "https://img20.360buyimg.com/babel/s300x300_jfs/t1/154292/15/5970/288814/5fb09efbE2d2fa336/bd07e29843ab769b.jpg.webp",
        name: "皮带",
      },
      {
        icon: "https://img14.360buyimg.com/babel/s300x300_jfs/t1/163727/1/7639/129177/603599abE2edf99e8/74205fba2c494400.jpg.webp",
        name: "袜子",
      }
    ],
    fsgoods: [{
        img: "https://img14.360buyimg.com/babel/s300x300_jfs/t1/138188/13/21469/72338/619f2558Efa578aef/98bee31f14bee0cc.jpg.webp",
        price: 399,
      },
      {
        img: "https://img10.360buyimg.com/babel/s300x300_jfs/t1/212950/32/8725/100445/61c42ba5Eec13cda1/4580b58099d17929.jpg.webp",
        price: 488,
      },
      {
        img: "https://img10.360buyimg.com/n7/jfs/t1/148181/17/5923/109620/5f3e3d67E747f5e92/4af1676de5627cbd.jpg",
        price: 868,
      },
      {
        img: "https://img10.360buyimg.com/n7/jfs/t1/159983/21/23129/112480/61b49481E1c78b8e3/008e3064cf899f5f.jpg",
        price: 168,
      },
      {
        img: "https://img11.360buyimg.com/n7/jfs/t1/170929/33/25905/54280/61a6389cE3df406f7/e3e2ea247e6e0d1e.jpg",
        price: 109,
      },
      {
        img: "https://img12.360buyimg.com/n8/jfs/t1/169730/11/21739/105753/617a50a1E1ec4cbd9/5a5bf9d501ed48e9.jpg",
        price: 58,
      }
    ],
    // 母婴
    myClassify: [{
        icon: "https://img12.360buyimg.com/babel/s400x400_jfs/t1/170899/30/16045/56977/6066cc5dE4a6e9289/08bbc75b803daa41.jpg!cc_400x400.webp",
        name: "奶粉",
      },
      {
        icon: "https://img30.360buyimg.com/babel/s320x320_jfs/t1/198883/40/12582/206816/6163d19dE0995a2d5/0fd4f5217f498883.jpg!cc_320x320.webp",
        name: "牙刷",
      },
      {
        icon: "https://img30.360buyimg.com/babel/s320x320_jfs/t1/174888/34/18787/95197/60e6b933Eeff1ee65/e47c5e4969a395ae.jpg!cc_320x320.webp",
        name: "乳粉",
      },
      {
        icon: "https://img12.360buyimg.com/babel/s320x320_jfs/t1/191409/10/9646/187822/60d06087E53a83d05/45823f8d3fa2bf46.jpg!cc_320x320.webp",
        name: "婴儿床",
      },
      {
        icon: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/29913/12/4604/42403/5c33c532E376fa991/a6bc82683b886a44.jpg",
        name: "奶瓶",
      },
      {
        icon: "https://img14.360buyimg.com/n7/jfs/t20341/361/2470474480/95796/62b8da7/5b57eb42Nb2c936a5.jpg",
        name: "餐具",
      },
      {
        icon: "https://img13.360buyimg.com/n7/jfs/t1/156260/20/21343/56879/6170e1a0Eb9bfc19e/db90b5abefe7ee08.jpg",
        name: "护臀霜",
      },
      {
        icon: "https://img13.360buyimg.com/cms/s190x190_jfs/t19366/273/2701847688/153488/933aaea4/5b07bd80Nde0700b3.jpg",
        name: "枕头",
      },
      {
        icon: "https://img12.360buyimg.com/n7/jfs/t1/142449/10/24261/183848/61c49d8bEf3840da1/58903728185199cc.jpg",
        name: "爬行垫",
      },
      {
        icon: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/195164/40/17466/83916/61109840E930c5f1b/b98b5dba0ec69a49.jpg",
        name: "婴儿背带",
      }
    ],
    mygoods: [{
        img: "https://img10.360buyimg.com/n7/jfs/t1/70507/11/15448/76194/5dce54dcE3742a6be/b0da82e9dce1f395.jpg",
        price: 52.8,
      },
      {
        img: "https://img13.360buyimg.com/n7/jfs/t1/169437/6/27795/109841/61b8bd04Ea5dce02a/7a9e227bbd0f6ac1.jpg",
        price: 2290,
      },
      {
        img: "https://img12.360buyimg.com/n7/jfs/t1/100630/1/13419/69296/5e57b02bEfb2f1c3c/e619d93d4194b051.jpg",
        price: 139,
      },
      {
        img: "https://img11.360buyimg.com/n2/jfs/t1/68083/2/1119/89953/5cf5e07eE36f364e0/5efc705818e63d70.jpg",
        price: 38,
      },
      {
        img: "https://img13.360buyimg.com/n7/jfs/t1/114523/1/13155/48598/5f1a8300E0633b625/72e07df5357659a0.jpg",
        price: 99,
      },
      {
        img: "https://img12.360buyimg.com/n7/jfs/t1/128828/30/7169/66304/5f0fe7e1E1c867c30/fbf6c2e64a7f534c.jpg",
        price: 158,
      }
    ],
    // 个护
    ghClassify: [{
        icon: "https://img11.360buyimg.com/n3/jfs/t16579/211/2318257462/85373/15bb99f9/5aa91cbbN417f2ea9.jpg!q80.webp",
        name: "洗发水",
      },
      {
        icon: "https://img14.360buyimg.com/n3/jfs/t4795/296/2372296918/79171/2af38c11/58ff1937N110be215.jpg!q80.webp",
        name: "抽纸",
      },
      {
        icon: "https://img13.360buyimg.com/n2/jfs/t1/162712/6/9331/50996/603f5e51E23ed13fd/8e7ed89acd45366a.jpg",
        name: "洗脸巾",
      },
      {
        icon: "https://img11.360buyimg.com/n2/jfs/t1855/66/2787060330/227165/1809ebab/571879bfN571107c2.jpg",
        name: "牙膏",
      },
      {
        icon: "https://img11.360buyimg.com/n2/jfs/t2974/49/1536929389/218628/3cc48411/5785ad43N8d4b1c1e.jpg",
        name: "牙刷",
      },
      {
        icon: "https://img10.360buyimg.com/n2/jfs/t16786/123/938693061/142034/fab5001a/5ab326e5Ne28bb616.jpg",
        name: "护舒宝",
      },
      {
        icon: "https://img13.360buyimg.com/n2/jfs/t1/126059/34/2188/201642/5ec47cb6Ef1e2fb9c/343e2c6bf44a7e0a.jpg",
        name: "洗面奶",
      },
      {
        icon: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/189192/6/13325/221873/60efe8c0E496f2966/941d16c18c949bde.jpg",
        name: "洗洁精",
      },
      {
        icon: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/199734/8/18639/89603/61a5db6bEb43421d6/18f9d2e0a2b07293.jpg",
        name: "消毒液",
      },
      {
        icon: "https://img14.360buyimg.com/n7/jfs/t1/190258/31/19482/79814/61206fc3E10ebe281/835a7c45d4ddbc65.jpg",
        name: "漱口水",
      }
    ],
    ghgoods: [{
        img: "https://img12.360buyimg.com/n7/jfs/t1/171966/12/16184/373737/60d156ebE182c2beb/98fdc25da63306fc.png",
        price: 39.5,
      },
      {
        img: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/150580/35/15004/58085/6001647dE7ee516d3/601af3c9f42f1711.jpg",
        price: 19.9,
      },
      {
        img: "https://img13.360buyimg.com/n7/jfs/t9340/235/30556456/149267/46772d1b/599f262aN994334fa.jpg",
        price: 35,
      },
      {
        img: "https://img13.360buyimg.com/n7/jfs/t1/143521/12/16230/65076/5fc4b57eE5a6eea4e/33af6db4b4bd3828.jpg",
        price: 27.9,
      },
      {
        img: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/172542/29/24408/128080/61c57c4fEfac92287/9b3d0a48da2a1de1.jpg",
        price: 19.8,
      },
      {
        img: "https://img11.360buyimg.com/n7/jfs/t1/155655/22/24381/67925/618a7664E309bccf7/83a4d2e3930d0f1c.jpg",
        price: 54,
      }
    ],
    // 数码
    smClassify: [{
        icon: "https://img30.360buyimg.com/babel/s320x320_jfs/t1/38722/13/1825/290419/5cbea1d6Eae62aeb8/82bd2ce75e8bc579.jpg!cc_320x320.webp",
        name: "相机",
      },
      {
        icon: "https://img10.360buyimg.com/babel/s320x320_jfs/t16549/318/2267503338/80842/749fe97c/5aa0a356Nf89f11c3.jpg!cc_320x320.webp",
        name: "无人机",
      },
      {
        icon: "https://img20.360buyimg.com/babel/s320x320_jfs/t1/65642/36/7321/68137/5d55076bE50dfe96c/180e9ff67053471b.jpg!cc_320x320.webp",
        name: "电动车",
      },
      {
        icon: "https://img20.360buyimg.com/babel/s320x320_jfs/t1/218328/28/5266/87215/619b0995Ebd6ebb21/05ded8e835b88fcc.jpg!cc_320x320.webp",
        name: "头盔",
      },
      {
        icon: "https://img20.360buyimg.com/babel/s320x320_jfs/t1/156004/35/5850/42592/5fffb0c6Ef89cfdcf/8d2daed2c6c51abc.jpg!cc_320x320.webp",
        name: "耳机",
      },
      {
        icon: "https://img11.360buyimg.com/babel/s320x320_jfs/t1/139538/1/7257/102319/5f4da9eeE6dcbccc1/21c80814703c63e7.jpg!cc_320x320.webp",
        name: "方向盘",
      },
      {
        icon: "https://img12.360buyimg.com/babel/s320x320_jfs/t1/195590/37/18982/61070/611f740dEd37f9654/f4f951979a59176d.jpg!cc_320x320.webp",
        name: "数据线",
      },
      {
        icon: "https://img12.360buyimg.com/babel/s320x320_jfs/t1/124257/28/15796/61272/5f90f74dE981be7f9/20185a926eac2421.jpg!cc_320x320.webp",
        name: "手表",
      },
      {
        icon: "https://img11.360buyimg.com/babel/s320x320_jfs/t1/171787/33/16071/29127/60d037b3Ea5ea4adc/b7667bb53ef03f1e.jpg!cc_320x320.webp",
        name: "翻译机",
      },
      {
        icon: "https://img20.360buyimg.com/babel/s320x320_jfs/t1/190204/16/13951/121519/60f55460E8fa76b25/46fc40edfdb3d858.jpg!cc_320x320.webp",
        name: "电视机",
      }
    ],
    smgoods: [{
        img: "https://img11.360buyimg.com/babel/s320x320_jfs/t1/200950/23/17304/172474/61a34e57E3b9abb0b/46bf19f3ac8017b1.jpg!cc_320x320.webp",
        price: 37999,
      },
      {
        img: "https://img12.360buyimg.com/babel/s320x320_jfs/t1/179645/25/17477/74999/6108e2bbEbee517c7/25ae3d40f596bb05.jpg!cc_320x320.webp",
        price: 990,
      },
      {
        img: "https://img13.360buyimg.com/babel/s320x320_jfs/t1/206006/40/3240/63307/612898e4Ec5abb685/86d59bc917111ad0.jpg!cc_320x320.webp",
        price: 6399,
      },
      {
        img: "https://img13.360buyimg.com/babel/s320x320_jfs/t1/203126/39/1550/28705/611a1b78E6fa33c19/836f5df1857a8e4b.jpg!cc_320x320.webp",
        price: 389,
      },
      {
        img: "https://img10.360buyimg.com/babel/s320x320_jfs/t4840/243/1762180645/118523/76f9bd72/58f4204bN00240fe1.jpg!cc_320x320.webp",
        price: 899,
      },
      {
        img: "https://img12.360buyimg.com/babel/s320x320_jfs/t1/189750/26/1599/40830/6093a8d1Eea1f41d2/067d97bc2ba5c7f0.jpg!cc_320x320.webp",
        price: 440,
      }
    ],
    // 运动
    ydClassify: [{
        icon: "https://img10.360buyimg.com/babel/s320x320_jfs/t1/52797/20/3515/105546/5d1316e2Eb9e25e8f/040e01d3a5035054.jpg!cc_320x320.webp",
        name: "登山包",
      },
      {
        icon: "https://img10.360buyimg.com/n7/jfs/t1/156295/11/8747/207132/601a43e3E18b58ba9/d219096cfd30b783.jpg",
        name: "篮球",
      },
      {
        icon: "https://img13.360buyimg.com/n7/jfs/t1/173512/33/6526/24788/6085085fEb9c37599/7e96ae6f21914efb.jpg",
        name: "乒乓球",
      },
      {
        icon: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/113382/14/25103/127651/61c3e03cEdfcd572a/e695906489a4b9ce.jpg",
        name: "羽毛球",
      },
      {
        icon: "https://img13.360buyimg.com/n7/jfs/t1/156305/14/15864/121585/604f347dE23060ac7/1a1382fea0a762d4.jpg",
        name: "轮滑",
      },
      {
        icon: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/145466/37/4207/124713/5f237467E2c3da2f5/44ca508ecdec3890.jpg",
        name: "椭圆机",
      },
      {
        icon: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/157842/3/24074/186404/61c4b0ecE91940aed/0800cb2bf3e00b3f.jpg",
        name: "跳绳",
      },
      {
        icon: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/186413/5/14008/86583/60f62ce2E34a6a561/8326281d2fee0193.jpg",
        name: "山地车",
      },
      {
        icon: "https://img13.360buyimg.com/n7/jfs/t9550/3/714085463/114860/52356d47/59d74d57Na1395bab.jpg",
        name: "拉力器",
      },
      {
        icon: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/195938/15/9739/67837/60d2ed8dEc7580f3c/2931638aceb3052b.jpg",
        name: "跑步机",
      }
    ],
    ydgoods: [{
        img: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/205266/37/12680/93326/617a0804E12607335/a14d569ec5f04ab9.jpg",
        price: 279,
      },
      {
        img: "https://img11.360buyimg.com/n7/jfs/t1/97762/5/11835/87967/5e40bedbE270c8a15/5fa0af4a3db72994.jpg",
        price: 208,
      },
      {
        img: "https://img13.360buyimg.com/cms/s190x190_jfs/t1/174603/30/5445/172445/607d8063Eebd30441/a76a398b5cb4a660.jpg",
        price: 789,
      },
      {
        img: "https://img11.360buyimg.com/n7/jfs/t1/57219/33/799/189300/5ce7b64cEbb36e5f0/227135cb8f0d630a.jpg",
        price: 289,
      },
      {
        img: "https://img13.360buyimg.com/n7/jfs/t1/122154/18/993/123846/5eb8f800E5cbadb82/a5dd8f45b71a1a07.jpg",
        price: 475,
      },
      {
        img: "https://img12.360buyimg.com/n7/jfs/t1/10541/24/11451/213492/5c6fa316Eda65980a/78dc6c8f0e360f47.jpg",
        price: 49.9,
      }
    ],

  },
  onLoad(options) {
    page = 0;
    let that = this;
    //  高度自适应
    wx.getSystemInfo({
      success: function (res) {
        var clientHeight = res.windowHeight,
          clientWidth = res.windowWidth,
          rpxR = 750 / clientWidth;
        var calc = clientHeight * rpxR + 2;
        console.log("calc", calc);
        that.setData({
          winHeight: calc
        });
      }
    });
    this.getshouyeList()
    this.getjujiaList()
    this.getmeishiList()
    this.getfushiList()
    this.getmuyingList()
    this.getgehuList()
    this.getshumaList()
    this.getyundongList()
  },

  getshouyeList() {
    // wx.showLoading({
    //   title: '加载中...',
    // })
    // let len = this.data.list.length
    // console.log("当前长度", len);
    wx.cloud.database().collection("goodsList")
      .skip(20 * page) //分页器
      .get()
      .then(res => {
        // wx.hideLoading()
        console.log("商品列表", res)
        let dataList = res.data
        // if (dataList.length <= 0) {
        //   wx.showToast({
        //     title: '没有更多数据了',
        //     icon: 'none',
        //   })
        // }
        this.setData({
          list: this.data.list.concat(res.data),
        })
        console.log(res.data);
      })
      .catch(res => {
        wx.hideLoading()
        console.log("请求失败", res);
      })
  },
  getjujiaList() {
    wx.showLoading({
      title: '加载中...',
    })
    let len = this.data.jujialist.length
    console.log("当前长度", len);
    wx.cloud.database().collection("jujiadata")
      .skip(len) //分页器
      .get()
      .then(res => {
        wx.hideLoading()
        console.log("商品列表", res)
        let dataList = res.data
        if (dataList.length <= 0) {
          // wx.showToast({
          //   title: '没有更多数据了',
          //   icon: 'none',
          // })
        }
        this.setData({
          jujialist: this.data.jujialist.concat(res.data),
        })
        console.log(res.data);
      })
      .catch(res => {
        wx.hideLoading()
        console.log("请求失败", res);
      })
  },
  getmeishiList() {
    wx.showLoading({
      title: '加载中...',
    })
    let len = this.data.meishilist.length
    console.log("当前长度", len);
    wx.cloud.database().collection("meishidata")
      .skip(len) //分页器
      .get()
      .then(res => {
        wx.hideLoading()
        console.log("商品列表", res)
        let dataList = res.data
        if (dataList.length <= 0) {
          // wx.showToast({
          //   title: '没有更多数据了',
          //   icon: 'none',
          // })
        }
        this.setData({
          meishilist: this.data.meishilist.concat(res.data),
        })
        console.log(res.data);
      })
      .catch(res => {
        wx.hideLoading()
        console.log("请求失败", res);
      })
  },
  getfushiList() {
    wx.showLoading({
      title: '加载中...',
    })
    let len = this.data.fushilist.length
    console.log("当前长度", len);
    wx.cloud.database().collection("fushidata")
      .skip(len) //分页器
      .get()
      .then(res => {
        wx.hideLoading()
        console.log("商品列表", res)
        let dataList = res.data
        if (dataList.length <= 0) {
          // wx.showToast({
          //   title: '没有更多数据了',
          //   icon: 'none',
          // })
        }
        this.setData({
          fushilist: this.data.fushilist.concat(res.data),
        })
        console.log(res.data);
      })
      .catch(res => {
        wx.hideLoading()
        console.log("请求失败", res);
      })
  },
  getmuyingList() {
    wx.showLoading({
      title: '加载中...',
    })
    let len = this.data.muyinglist.length
    console.log("当前长度", len);
    wx.cloud.database().collection("muyingdata")
      .skip(len) //分页器
      .get()
      .then(res => {
        wx.hideLoading()
        console.log("商品列表", res)
        let dataList = res.data
        if (dataList.length <= 0) {
          // wx.showToast({
          //   title: '没有更多数据了',
          //   icon: 'none',
          // })
        }
        this.setData({
          muyinglist: this.data.muyinglist.concat(res.data),
        })
        console.log(res.data);
      })
      .catch(res => {
        wx.hideLoading()
        console.log("请求失败", res);
      })
  },
  getgehuList() {
    wx.showLoading({
      title: '加载中...',
    })
    let len = this.data.gehulist.length
    console.log("当前长度", len);
    wx.cloud.database().collection("gehudata")
      .skip(len) //分页器
      .get()
      .then(res => {
        wx.hideLoading()
        console.log("商品列表", res)
        let dataList = res.data
        if (dataList.length <= 0) {
          // wx.showToast({
          //   title: '没有更多数据了',
          //   icon: 'none',
          // })
        }
        this.setData({
          gehulist: this.data.gehulist.concat(res.data),
        })
        console.log(res.data);
      })
      .catch(res => {
        wx.hideLoading()
        console.log("请求失败", res);
      })
  },
  getshumaList() {
    wx.showLoading({
      title: '加载中...',
    })
    let len = this.data.shumalist.length
    console.log("当前长度", len);
    wx.cloud.database().collection("shumadata")
      .skip(len) //分页器
      .get()
      .then(res => {
        wx.hideLoading()
        console.log("商品列表", res)
        let dataList = res.data
        if (dataList.length <= 0) {
          // wx.showToast({
          //   title: '没有更多数据了',
          //   icon: 'none',
          // })
        }
        this.setData({
          shumalist: this.data.shumalist.concat(res.data),
        })
        console.log(res.data);
      })
      .catch(res => {
        wx.hideLoading()
        console.log("请求失败", res);
      })
  },
  getyundongList() {
    wx.showLoading({
      title: '加载中...',
    })
    let len = this.data.yundonglist.length
    console.log("当前长度", len);
    wx.cloud.database().collection("yundongdata")
      .skip(len) //分页器
      .get()
      .then(res => {
        wx.hideLoading()
        console.log("商品列表", res)
        let dataList = res.data
        if (dataList.length <= 0) {
          // wx.showToast({
          //   title: '没有更多数据了',
          //   icon: 'none',
          // })
        }
        this.setData({
          yundonglist: this.data.yundonglist.concat(res.data),
        })
        console.log(res.data);
      })
      .catch(res => {
        wx.hideLoading()
        console.log("请求失败", res);
      })
  },
  // 跳详情
  goDetail(e) {
    let id = e.currentTarget.dataset.item._id
    console.log(e.currentTarget.dataset.item._id);
    wx.navigateTo({
      url: '/pages/detail/detail?id=' + id,
    })
  },
  // 滚动切换标签样式
  switchTab: function (e) {
    let that = this;
    // console.log("滚动切换标签",e)
    that.setData({
      currentTab: e.detail.current
    });
    that.checkCor();
  },
  // 点击标题切换当前页时改变样式
  swichNav: function (e) {
    let cur = e.currentTarget.dataset.current;
    if (this.data.currentTab == cur) {
      return false;
    } else {
      this.setData({
        currentTab: cur
      })
    }
  },
  //判断当前滚动超过一屏时，设置tab标题滚动条。
  checkCor: function () {
    let that = this;
    if (that.data.currentTab > 3) {
      that.setData({
        scrollLeft: 300
      })
    } else {
      that.setData({
        scrollLeft: 0
      })
    }
  },
  // 跳转页面
  tofunction: function (e) {
    wx.navigateTo({
      url: e.currentTarget.dataset.url,
    })
  },
  toFunction: function (e) {
    wx.navigateTo({
      url: e.currentTarget.dataset.url,
    })
  },
  toXiaoTuMiaoSha: function (e) {
    wx.navigateTo({
      url: "../shouye/shouye",
    })
  },
  //页面上拉触底事件的处理函数
  onReachBottom: function () {
    page++
    this.getshouyeList()
    this.getjujiaList()
    this.getmeishiList()
    this.getfushiList()
    this.getmuyingList()
    this.getgehuList()
    this.getshumaList()
    this.getyundongList()
    // this.getListTwo()
    // console.log("onReachBottom");
  },
})